import {app, Menu, ipcMain} from "electron"
import {IpcEvents} from "../../common/ipcEvents";

export default Menu.buildFromTemplate([
    {
        label: "何方笔记",
        role: "appMenu",
        submenu: [
            {
                label: "关于",
                click() {
                    ipcMain.emit(IpcEvents.OPEN_ABOUT)
                }
            },
            {
                label: "开发者工具",
                role: "toggleDevTools"
            },
            {
                label: "检查更新",
                click() {
                    ipcMain.emit(IpcEvents.CHECK_UPDATE)
                }
            },
            {type: "separator"},
            {
                label: "重启应用",
                click() {
                    app.relaunch()
                    app.exit(0)
                }
            },
            {
                label: "退出",
                role: "quit"
            }
        ]
    }
])